package cn.vawn.exam.mapper;

import cn.vawn.exam.entity.PaperType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface PaperTypeMapper {

    /**
     * 查询问卷类型
     * @param typeName
     * @param startTime
     * @param endTime
     * @return
     */
    List<PaperType> searchPaperType(@Param("typeName") String typeName,
                                    @Param("startTime") Date startTime,
                                    @Param("endTime") Date endTime);

    PaperType selectById(@Param("id") Integer id);

    int insert(PaperType paperType);

    int insertSelective(PaperType paperType);

    int update(PaperType paperType);

    int updateSelective(PaperType paperType);

    @Delete("UPDATE PAPER_TYPE SET IS_DELETED = 1, UPDATED_TIME = #{updatedTime}, UPDATED_BY = #{updatedBy} WHERE ID = #{id}")
    void delete(PaperType paperType);

    List<PaperType> selectAllType();
}